home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / docs / cmdshlp8 / dialer < prev    next >
Encoding:
Text File  |  1995-06-26  |  4.9 KB  |  166 lines

  1.  
  2. dialer
  3.  
  4.         dialer <interface> [<dialer_file> [<seconds> [<pings> [<hostid>]]]]
  5.  
  6.         Set up an autodialer session for the interface.  Whenever the
  7.         interface is idle for the interval in <seconds>, the autodialer
  8.         will ping the <hostid>.  If there is no answer after <pings>
  9.         attempts, the autodialer will execute the special commands
  10.         contained in the <dialer_file>.
  11.  
  12.         If no <dialer_file> is specified, a previous dialer command
  13.         process will be removed.  If the number of <pings> is omitted, the
  14.         <dialer_file> will be executed without first pinging the <host>.
  15.  
  16.         The file may have any valid name, and must be located in the NOS
  17.         root directory.  The dialer commands in the file are the
  18.         following:
  19.  
  20.         >> Examples:  dialer sl0 ns9tel.dia 30 10 ns9tel
  21.  
  22.  
  23. DIALER FILE COMMANDS
  24.  
  25.         control down|up
  26.  
  27.         Control the 'asy' interface.  The 'down' option drops DTR and
  28.         RTS.  The 'up' option asserts DTR and RTS.
  29.  
  30.         >>  Example:  control down
  31.  
  32.  
  33.  
  34.         send "<string>" [<milliseconds>]
  35.  
  36.         This dialer command will write the specified string to the
  37.         interface. The string quote marks are required, and the string
  38.         may not contain embedded control characters.  However, the
  39.         standard C string escape sequences are recognized (but \0 should
  40.         not be used).  If <milliseconds> is specified, the <string>
  41.         characters are sent with a <milliseconds> inter-character delay,
  42.         useful for ancient Micom switches!
  43.  
  44.         >> Example:  send "atdt555-1212"
  45.  
  46.  
  47.  
  48.         speed [ 115200|57600|38400|19200|9600|4800|2400|1200|300 ]
  49.  
  50.         This command sets the speed of the interface to one of the
  51.         available speeds.  If the speed argument is missing, the speed
  52.         will be displayed in the dialer session window.
  53.  
  54.         >> Example:  speed 1200
  55.  
  56.  
  57.  
  58.         wait <milliseconds> [ "test_string" ] [speed]
  59.  
  60.         If only the time is specified, the dialer pauses for the desired
  61.         number of milliseconds.  Otherwise, the dialer reads until the
  62.         <test_string> is detected on the interface.
  63.  
  64.         If the string is not detected within the desired time, the
  65.         autodialer will reset.  The string quote marks are required, and
  66.         the string may not contain embedded control characters. However,
  67.         the standard C string escape sequences are recognized (but \0
  68.         should not be used).
  69.  
  70.         If the "speed" keyword is specified, the dialer will continue
  71.         to read characters until a non-digit is detected.  The string
  72.         read is converted to an integer, and used to set the interface
  73.         speed.  If the trailing non-digit is not detected within the
  74.         desired time, or the integer value is not a valid speed, the
  75.         autodialer will reset.
  76.  
  77.         >> Example:  wait 45000 "CONNECT" speed
  78.  
  79.  
  80. DIALER FILE EXTENDED COMMANDS
  81.  
  82.  
  83.         failmode  [ on | OFF ]
  84.  
  85.         'failmode' establishes whether the dialer should continue after
  86.         a failed dialer command.  <off> implies abort the dialing script,
  87.         while <on> means continue the script, which in effect enables
  88.         the 'ifok' and 'iffail' commands.
  89.  
  90.  
  91.         begin
  92.  
  93.         'begin' starts a block of commands, and is typically used
  94.         after an 'ifok' or 'iffail' command.
  95.  
  96.  
  97.         end
  98.  
  99.         'end' terminates a block of commands, which extends to the
  100.         previous unpaired 'begin'.
  101.  
  102.  
  103.         exit [<return_code>]
  104.  
  105.         'exit' ends the dialer script, with the result code set to that
  106.         of the previous dialer command unless <return_code> is specified.
  107.  
  108.  
  109.         status  [ up | down ]
  110.  
  111.         'status' is similar to the 'control' command, except that the
  112.         iostatus() routine is notified.
  113.  
  114.  
  115.         ifok <cmd>
  116.  
  117.         'ifok' invokes the dialer command <cmd> if the previous command
  118.         was successful.
  119.  
  120.  
  121.         iffail <cmd>
  122.  
  123.         'iffail' invokes the dialer command <cmd> if the previous command
  124.         was not successful.
  125.  
  126.  
  127. DIALER EXAMPLE FILE
  128.  
  129. The following dialer script will perform these steps:
  130. . drop DTR & RTS to force a hangup
  131. . wait 2 seconds and then raise DTR & CTS
  132. . set the port speed to 9600 baud and initialize the modem
  133. . dial a number and wait for the modem to return a CONNECT message
  134. . (abort if the dial-out was unsuccessful)
  135. . turn on continue-after-error mode
  136. . try three times to send a CR and obtain a Login: prompt
  137. . send my login name, password, wait 5 seconds and then exit
  138.  
  139. control down
  140. wait 2000
  141. control up
  142. speed 9600
  143. send "atz\ratm0l0e0\r"
  144. wait 1000
  145. send "atdt555-1212\r"
  146. wait 45000 "CONNECT"
  147. wait 2000
  148. failmode on
  149. send "\r"
  150. wait 5000 "ogin"
  151. iffail begin
  152.  send "\r"
  153.  wait 5000 "ogin"
  154.  iffail begin
  155.   send "\r"
  156.   wait 5000 "ogin"
  157.  end
  158. end
  159. wait 1000
  160. send "myname\r"
  161. wait 5000 "assword"
  162. wait 1000
  163. send "mypassword\r"
  164. wait 5000
  165. exit
  166.